package org.springframework.prospring.ticket.domain.ui;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * Created by IntelliJ IDEA.
 * User: Alexis Quiros
 * Date: 02/03/2009
 * Time: 16:43:49
 * To change this template use File | Settings | File Templates.
 */
@XStreamAlias("Response")
public class Response {

	private ResponseMessage responseMessage;
	private String correlationId;
	//private ScreenLayout layout;
	private String dataLayout;
    private List<Object> data;
    private Object dataObject;

	public Response() {
		super();
	}

	public Response(ResponseMessage message) {
		this.setResponseMessage(message);
	}

	public ResponseMessage getResponseMessage() {
		return responseMessage;
	}

	public void setResponseMessage(ResponseMessage responseMessage) {
		this.responseMessage = responseMessage;
	}

	public String getCorrelationId() {
		return this.correlationId;
	}

	public void setCorrelationId(String correlationId) {
		this.correlationId = correlationId;
	}

	/*public ScreenLayout getScreenLayout() {
		return layout;
	}

	public void setScreenLayout(ScreenLayout screenLayout) {
		this.layout = screenLayout;
	}*/

	public String getGridLayout() {
		return dataLayout;
	}

	public void setGridLayout(String gridLayout) {
		this.dataLayout = gridLayout;
	}

	public List<Object> getData() {
		return data;
	}

	public void setDataList(List<Object> data) {
		this.data = data;
	}

	public void addData(Object o) {
		if (this.data == null) {
			this.data = new ArrayList<Object>();
		}
		this.data.add(o);
	}

	public void addAllData(Collection o) {
		if (this.data == null) {
			this.data = new ArrayList<Object>();
		}
		this.data.addAll(o);
	}


    public Object getDataObject() {
        return dataObject;
    }

    public void setDataObject(Object dataObject) {
        this.dataObject = dataObject;
    }
}